import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Character from '../components/character/main.vue'
import MainPage from '../components/main/main.vue'
import Scripts from '../components/scripts/main.vue'
import Rooms from '../components/room/main.vue'
import RoomDetail from '../components/room/roomDetail.vue'
import Forum from '../components/forum/main.vue'
import TopicDetail from '../components/forum/topicDetail.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'main',
    component: MainPage
  },
  {
    path: '/character',
    name: 'character',
    component: Character
  },
  {
    path: '/scripts',
    name: 'scripts',
    component: Scripts
  },
  {
    path: '/rooms',
    name: 'rooms',
    component: Rooms
  },
  {
    path: '/room/detail/:id',
    name: 'roomDetail',
    component: RoomDetail
  },
  {
    path: '/forum',
    name: 'forum',
    component: Forum
  },
  {
    path: '/forum/topic/:topicId/:title/:isLocked',
    name: 'topicDetail',
    component: TopicDetail
  }
]

const router: any = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
